package com.ludomancy.sos64;

import java.awt.Graphics;
import java.awt.Point;
import java.awt.Rectangle;

public class Component
{
	public int x;
	public int y;
	
	public Component(int x, int y)
	{
		this.x = x;
		this.y = y;
	}
	
	public void onPlacement()
	{
	}
	
	public Point getSize()
	{
		return new Point(40,40);
	}
	
	public void paint(Graphics g)
	{
		paint(g, x, y);
	}

	public void paint(Graphics g, int px, int py)
	{
	}
	
	public boolean available()
	{
		return true;
	}
	
	public Point getHotspot()
	{
		return new Point(x + getSize().x/2, y + getSize().y/2);
	}
	
	public boolean canMove()
	{
		return available();
	}
	
	public boolean isMadeOfMetal()
	{
		return false;
	}
	
	public boolean isOrganic()
	{
		return false;
	}
	
	public void onCollided(Component other)
	{
	}
	
	public void onMoving()
	{
		
	}
	
	public void onMoved()
	{
		
	}
	
	public boolean snapToTile()
	{
		return false;
	}
	
	public Point center()
	{
		return new Point(x + getSize().x/2, y + getSize().y/2);
	}
	
	public Rectangle area()
	{
		return new Rectangle(x, y, getSize().x, getSize().y);
	}
	
	public void update()
	{
	}

	public void onClick(Point point)
	{
	}
}
